/**
 * Copyright (c) 2008, Julien PORTALIER
 * http://featherphp.googlecode.com/
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 */

window.addEvent('domready', function()
{
	$$('fieldset .input-label').each(function(p)
	{
		var label = p.getElement('label');
		if (label)
		{
			var input = p.getElement('input');
			if (input.value.trim() != '') {
				label.setStyle('display', 'none');
			}
			input.addEvents({
				'focus': function() {
					label.setStyle('display', 'none');
				},
				'blur': function()
				{
					if (input.value.trim() == '') {
						label.setStyle('display', '');
					}
				}
			});
		}
	});
});
